<?PHP
	include_once 'classThumb.phpm';    
	include_once 'function_createthumb.phpm';    

/*
$uploaddir = 'tmpImage/';

if(count($_FILES)){
    if( $_FILES['myimage']['error']==0 ){
        $imagename = basename($_FILES['myimage']['name']);
        $uploadfile = $uploaddir . basename($_FILES['myimage']['name']);
        echo '<pre>';
        
        if (move_uploaded_file($_FILES['myimage']['tmp_name'], $uploadfile)) {
            echo "File is valid, and was successfully uploaded.\n";            
            header("Location: crop.php?mainimg=$imagename");
            exit;
        } else {
           echo "Possible file upload attack!\n";
        }



    }else{
        echo 'Uploading Failed';
    }
}
*/
//Here is the sample to user the code:---------
	$imageName = 'myimages.jpeg';
	$sourceFile = 'images/'.$imageName;
	$saveFilePath = "thumbnails/".'thumb_'.$imageName  ; 
	create_thumb($sourceFile, $size, $saveFilePath);    


//HERE IS THE CODE TO FETCH THE THUMB OF THE IAMGE
	$imgSrc = imageSrc($GLOBALS['userThumbImagePrefix'], $image_name, $thumbFolderPath, $thumbHeight, $thumbWidth, $mainFolderPath);

	echo "<src $imgSrc>";



?>